grammar testantlr;

@header {
package odesimulation;
}

reactionset	
locals [
List<String> symbols = new ArrayList<String>()
] : (reaction';')+;
reaction	: leftside '->' rightside | enzleftside '->' enzrightside;
leftside	: id | id '+' id;
rightside	: | id | id '+' id;
enzleftside	: id '+' ENZYME | ENZYME '+' id;
enzrightside	: ENZYME | ENZYME '+' id | ENZYME '+' id '+' id;
id 	: ID {if ( !$reactionset::symbols.contains($ID.text) ) { $reactionset::symbols.add($ID.text); } } ;
ID	: [a-z] ;
PARAM	: [A-Z] ;
ENZYME	: 'Enz'NUM;
NUM	: [0-9]+;
WS	: [ \r\t\n]+ -> skip;